/*
 */

#ifndef _FINATE_STATE_MACHINE_HEAD
#define _FINATE_STATE_MACHINE_HEAD

typedef void *(*Shrunken) (void *,uint32_t);
typedef void (*Boosting) (void *);

struct Pieces;

typedef struct _PBricks{

       void *global_parameters; 
       uint32_t begin,end;
       void **input;
//       void *input;
       void *output;
       void (*pfuncs)(void *);
       void *(*assign_addr)(void *,uint32_t);

       void *reward;

	   void 	*__null_used_pointer_for_align1;
       uint32_t max_tail;

} Pbricks;
        

typedef struct _Pieces {
       struct timeval tv; 

       pthread_t *threads;
       pthread_mutex_t lock;
       pthread_cond_t  cwait;

       unsigned int thread_count,pcount;
       
       const pthread_attr_t *attr;

       uint32_t len_of_mark,len_of_bricks;

       Pbricks **brick;
       void *__null_used_pointer_for_align1;

       Boosting boosting;
       Shrunken shrunken;
} Pieces;

#endif
